package com.fenghuajueli.lib_pictureselect.utils;

import android.content.Context;
import android.net.Uri;
import android.widget.ImageView;

import com.blankj.utilcode.util.LogUtils;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;

/**
 * 图片选择器的预览图加载工具，通过uri去 加载数据
 */
public class GlideLoadUtils {

    public static void load(Context context, Uri uri, ImageView imageView) {
        try {
            Glide.with(context).load(uri).into(imageView);
        } catch (Exception e) {
            LogUtils.e("图片加载异常：" + e.toString());
        }
    }


    public static void load(Context context, String path, ImageView imageView) {
        try {
            Glide.with(context).load(path).into(imageView);
        } catch (Exception e) {
            LogUtils.e("图片加载异常：" + e.toString());
        }
    }

    public static void loadVideoCover(Context context, Uri uri, ImageView imageView){
        RequestOptions requestOptions = new RequestOptions();
        //Glide.with(context).applyDefaultRequestOptions().load(uri).
    }
}
